/* 
    包含应用中所有请求接口
*/

import ajax from './ajax'

//获取token
export const reqGetToken = ({ idNum, _t }) => ajax('/api/RecruitSystemLogin/Login', 'get', false, { idNum, _t })

//获取试卷列表
export const reqGetPaperInfo = (_t) => ajax('/api/PaperInfo/GetPaperInfo', 'get', true, { _t })

//验证考试信息是否存在
export const reqCheckPaperInfo = (paperTemplateId) => ajax('/api/Paper/CheckPaperInfo', 'post', true, { paperTemplateId })

//开始考试 生成试卷
export const reqStartAnswer = ({ paperInfoId, paperTemplateId }) => ajax('/api/Paper/Post', 'post', true, { paperInfoId, paperTemplateId })

//继续考试 获取答题情况
export const reqContinueAnswer = ({ id, _t }) => ajax('/api/Paper/GetPaper', 'get', true, { id, _t })

//提交试卷
export const reqSubmitPaper = ({ paperId, answerQuestionViewModels }) => ajax('/api/Paper/Put', 'put', true, {}, { paperId, answerQuestionViewModels })

//试卷自动提交
export const reqSubmitAuto = ({ paperId, answerQuestionViewModels }) => ajax('/api/Question/Put', 'put', true, {}, { paperId, answerQuestionViewModels })

//确认考试结束
export const reqConfirmEnd = () => ajax('/api/PaperInfo/PutCandidate', 'put', true)